#coding: utf-8
class CulturalHeritage::CulturePoint < ActiveRecord::Base
  default_scope where("deleted = 0")
  belongs_to :obj_culture, :class_name => 'CulturalHeritage::Culture',  :foreign_key => 'culture'

  def self.count_culture_dependencies(id)
      return find(:all,:conditions=>["cultural_heritage_culture_points.culture = ? and (cultural_heritage_culture_points.deleted = ?) ",id,0],:select=>"count(*) as 'culture_points'")[0].culture_points.to_i
  end
end
